package cn.yh.kettle_service.utils;

import lombok.Data;

@Data
public class Results<T> {
    private int code;
    private String message;
    private T data;

    public static <T> Results<T> success(T data) {
        Results<T> r = new Results<>();
        r.setCode(200);
        r.setMessage("操作成功");
        r.setData(data);
        return r;
    }

    public static <T> Results<T> fail(String message) {
        Results<T> r = new Results<>();
        r.setCode(500);
        r.setMessage(message);
        return r;
    }
}
